#ifndef VISUALCOMPONENTSEGMENT_H_
#define VISUALCOMPONENTSEGMENT_H_

#include "model/der/ViaDER.h"
#include "gui/VisualComponents/VisualComponent.h"
#include "utils/Point.h"
#include "gui/VisualComponents/ArrowHead.h"

class VisualComponentVia;

class VisualComponentSegment : public VisualComponent{
private:
	bool m_isVertical;
	bool m_lastSegment;
    Point* m_startPoint;
    Point* m_endPoint;
    ArrowHead* m_arrowHead;
    ArrowHead::ArrowStyle m_arrow_style;
    enum Orientation m_orientation;
    void updateArrowStyle();
public:
	VisualComponentSegment(Point* start, Point* end, bool isVertical, ArrowHead::ArrowStyle style);

	virtual ~VisualComponentSegment();

	virtual InfluenceArea getInfluenceArea();
	virtual void on_expose(Cairo::RefPtr<Cairo::Context> ptrContext);
	virtual void on_move(int mouseX, int mouseY);

	virtual void draw(Cairo::RefPtr<Cairo::Context> ptrContext);

	virtual int getX() const;
	virtual void setX(int x);
	virtual int getY() const;
	virtual void setY(int y);

	bool isVertical();
	bool isMobile();
	int getLength();
    Point *getStartPoint() const;
    void setStartPoint(Point *startPoint);
    Point *getEndPoint() const;
    void setEndPoint(Point *endPoint);

    void setAsLastSegment();

    void setNotAsLastSegment();

    void setOrientation(enum Orientation o);

};

#endif /* VISUALCOMPONENTSEGMENT_H_ */
